﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PMS.Data.DbUtils.DataMapping;
using PMS.Data.Entities.Messages;

namespace PMS.Data.EntityMap.Messages
{
    /// <summary>
    /// Represents a ShortMessageTemplate mapping configuration
    /// </summary>
    public partial class ShortMessageTemplateMap : PMSEntityTypeConfiguration<ShortMessageTemplate>
    {
        #region Methods

        /// <summary>
        /// Configures the entity
        /// </summary>
        /// <param name="builder">The builder to be used to configure the entity</param>
        public override void Configure(EntityTypeBuilder<ShortMessageTemplate> builder)
        {
            builder.ToTable("msg_smstemplate");
            builder.HasKey(template => template.Id);

            builder.Property(template => template.SmsTemplateName).HasMaxLength(128).IsRequired();
            builder.Property(template => template.TemplateId).HasMaxLength(128).IsRequired();
            builder.Property(template => template.TemplateDescription).HasMaxLength(200);

            base.Configure(builder);
        }

        #endregion
    }
}
